package com.yyfax.common.form;

import android.content.Context;

import com.yyfax.common.CLog;
import com.yyfax.common.toast.CompatToast;
import com.yyfax.common.tools.RegularExpress;
import com.yyfax.common.tools.Toaster;

/**
 * Created by fuqiang on 2017/5/4.
 * 普通校验
 * Copyright  2017 www.yylending.com. All Rights Reserved.
 */
public class NormalValidate {
    public static boolean validate(Context context, ClearEditText clearEditText, NoticeText noticeText) {
        if (RegularExpress.isEmpty(clearEditText)) {
			CompatToast.showShortToast(context.getApplicationContext(), noticeText.mEmptyMsg);
            return false;
        }
        if (RegularExpress.existExpression(clearEditText.getFormText())) {
			CompatToast.showShortToast(context.getApplicationContext(), noticeText.mExpressionMsg);
            return false;
        }
        return true;
    }
}
